package com.wangbo.decorator;

/**
 * 自动驾驶装饰器
 */
public class AutoCarDecorator extends CarDecorator{
    public AutoCarDecorator(Car decoratedCar) {
        super(decoratedCar);
    }

    @Override
    public void run() {
        auto();
        decoratedCar.run();  // 使用继承自父类的decoratedCar
    }

    /**
     * 开启自动驾驶模式
     */
    private void auto() {
        System.out.println("Enable auto mode.");
    }
}
